<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue生命周期</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>



<script>

    var vm = new Vue({
        data: {
            a: 1
        },
        created: function () {
            // `this` 指向 vm 实例
            console.log('a is: ' + this.a)
            console.log("This is create funcation .....")
        },

        amount:function () {
            console.log("This is amount funcation .....")
        },
        updated:function () {
            console.log("This is updated funcation .....")
        },
        destroyed:function () {
            console.log("This is destroyed funcation .....")
        },
        beforeDestroy:function () {
            console.log("This is beforeDestroy funcation .....")
        }
    })

    console.log("I will call $destroy .....")
    vm.$destroy();

</script>
</body>
</html>